﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;


/// <summary>
/// sysSelect 的摘要说明
/// </summary>
public class sysSelect
{
	public sysSelect()
	{
		//
		// TODO: 在此处添加构造函数逻辑
		//
	}

    SqlConnection conn = new SqlConnection(ConfigurationManager.AppSettings["Connection"]);

    #region 查看
    public DataSet SelectInfo(string strsql)
    {
        DataSet ds = new DataSet();
        try
        {
            conn.Open();
            SqlDataAdapter da = new SqlDataAdapter(strsql, conn);
            da.Fill(ds, "table");
        }
        catch (Exception ex)
        {
            throw (ex);
        }
        finally
        {
            conn.Close();
        }
        return ds;
    }
    #endregion

    #region 获取考勤时间
    public SqlDataReader SelectWorkTime()
    {
        SqlDataReader dr = null;
        try
        {
            conn.Open();
            SqlCommand comm=new SqlCommand("select * from WorkTimeSet",conn);
            dr = comm.ExecuteReader();

        }
        catch(Exception ex)
        {
            throw(ex);
        }
        //finally
        //{
        //    conn.Close();
        //}
        return dr;
    }
    #endregion
}
